export default {
  color: [{color:"#3583FF",num:0},
        {color:"#FB7962",num:0},
        {color:"#A5D33E",num:0},
        {color:"#FFCD3A",num:0},
        {color:"#68A2FF",num:0},
        {color:"#8F46D8",num:0},
        {color:"#F078A1",num:0},
        {color:"#33BDB9",num:0},
        {color:"#FF9901",num:0},
        {color:"#9AC1FF",num:0},
        {color:"#64BF00",num:0},
    ],
    optionTemplate: {
        "backgroundColor": {
            type: 'linear',
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [{
                offset: 0, color: '#ffffff' // 0% 处的颜色
            }, {
                offset: 1, color: '#e6fffb' // 100% 处的颜色
            }],
            global: false // 缺省为 false
        },
        "title": {
            "text": ""
        },
        "color": [
            "#3583FF",
            "#FB7962",
            "#A5D33E",
            "#FFCD3A",
            "#68A2FF",
            "#8F46D8",
            "#F078A1",
            "#33BDB9",
            "#FF9901",
            "#9AC1FF",
            "#64BF00"
        ],
        "tooltip": {
            "trigger": "item",
            "triggerOn": "mousemove",
            formatter: (params) => {
                const { name, data } = params
                let isNode = !!data.name;
                if (isNode) {
                   return  "<div style=\"background-color: #1f2f3d;width: 308px;height: 120px\">\n" +
                       "            <div style=\"width: 100%;height: 40px;display: flex;flex-direction: row\">\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 104px;height: 100%;\">\n" +
                       "                    <div class=\"grid-content bg-purple\"><div\n" +
                       "                            style=\"color: #ffffff;position: relative;top: 10px;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;\">"+data.label.formatter.substring(data.label.formatter.indexOf('|') + 1, data.label.formatter.indexOf('}'))+"</div></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 96px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">会话数</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 84px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">比例</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "            </div>\n" +
                       "            <div style=\"width: 100%;height: 40px;display: flex;flex-direction: row\">\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 104px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple\"><div\n" +
                       "                            style=\"color: #ffffff;position: relative;float:left;top: 10px\"><div style=\"display: inline-block;height: 8px;width: 8px;background-color: rgb(72, 139, 255);border-radius: 4px;margin-right: 10px\"></div>留存</div></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 96px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.label.rich.data.storageNum+"</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 84px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.label.rich.data.storagePer+"%</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "            </div>\n" +
                       "            <div style=\"width: 100%;height: 40px;display: flex;flex-direction: row\">\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 104px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple\"><div\n" +
                       "                            style=\"color: #ffffff;position: relative;float:left;top: 10px\"><div style=\"display: inline-block;height: 8px;width: 8px;background-color: #fd6865;border-radius: 4px;margin-right: 10px\"></div>流失</div></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 96px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.label.rich.data.wastageNum+"</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 84px;height: 100%\">\n" +
                       "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                       "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.label.rich.data.wastagePer+"%</span></div>\n" +
                       "                </div>\n" +
                       "                <div style=\"width: 12px\">\n" +
                       "\n" +
                       "                </div>\n" +
                       "            </div>\n" +
                       "        </div>";
                }else{
                    return  "<div style=\"background-color: #1f2f3d;width: 408px;height: 90px\">\n" +
                        "            <div style=\"width: 100%;height: 40px;display: flex;flex-direction: row\">\n" +
                        "                <div style=\"width: 12px\">\n" +
                        "\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 204px;height: 100%;\">\n" +
                        "                    <div class=\"grid-content bg-purple\"><div\n" +
                        "                            style=\"color: #ffffff;position: relative;top: 10px;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;\">"+data.lineText+"</div></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 96px;height: 100%\">\n" +
                        "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                        "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">会话数</span></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 84px;height: 100%\">\n" +
                        "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                        "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">比例</span></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 12px\">\n" +
                        "\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "            <div style=\"width: 100%;height: 40px;display: flex;flex-direction: row\">\n" +
                        "                <div style=\"width: 12px\">\n" +
                        "\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 204px;height: 100%\">\n" +
                        "                    <div class=\"grid-content bg-purple\"><div\n" +
                        "                            style=\"color: #ffffff;position: relative;float:left;top: 10px\"><div style=\"display: inline-block;height: 8px;width: 8px;background-color: rgb(72, 139, 255);border-radius: 4px;margin-right: 10px\"></div>留存</div></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 96px;height: 100%\">\n" +
                        "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                        "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.valueShow+"</span></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 84px;height: 100%\">\n" +
                        "                    <div class=\"grid-content bg-purple-light\"><span\n" +
                        "                            style=\"color: #ffffff;position: relative;float:right;top: 10px\">"+data.sourcePre+"%</span></div>\n" +
                        "                </div>\n" +
                        "                <div style=\"width: 12px\">\n" +
                        "\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "        </div>";
                }
            }
        },
        "animation": false,
        "series": [
            {
                "type": "sankey",
                "bottom": "16%",
                "top": "12%",
                "data": [],
                "links": [],
                "lineStyle": {
                    "color": "source",
                    "curveness": 0.3
                }
            }
        ]
    },
    /* data_type 为 bool 时选，没有 3 级信息 */
    boolOpts: [
        { key: 'isTrue', name: '为真' },
        { key: 'isFalse', name: '为假' },

        { key: 'isSet', name: '有值' },
        { key: 'notSet', name: '无值' },
    ],

    /* data_type 为 string 时选 */
    textOpts: [
        { key: 'equal', name: '等于' },             // 可输入多个字符串
        { key: 'notEqual', name: '不等于' },

        { key: 'contain', name: '包含' },
        { key: 'notContain', name: '不包含' },

        { key: 'isSet', name: '有值' },
        { key: 'notSet', name: '无值' },
        { key: 'isEmpty', name: '为空' },
        { key: 'isNotEmpty', name: '不为空' },

        // { key: 'rlike', name: '正则匹配' },
        // { key: 'notrlike', name: '正则不匹配' },
    ],

    /* data_type 为 number 时选 */
    numberOpts: [
        { key: 'equal', name: '等于' },         // 可输入多个数字
        { key: 'notEqual', name: '不等于' },

        { key: 'less', name: '小于' },          // 只需输入一个数字
        { key: 'greater', name: '大于' },

        { key: 'between', name: '区间' },       // 需输入 2 个数字，并且

        { key: 'isSet', name: '有值' },
        { key: 'notSet', name: '无值' },
    ],

    /* data_type 为 datetime 时选  */
    datetimeOpts: [
        { key: 'absolute_between', name: '绝对时间' },    // 任意时间区间（精确到分，但是好像是写死 00:00）
        { key: 'relative_within', name: '相对当前时间点', arr: [{ key: 'relative_within', name: '之内' }, { key: 'relative_before', name: '之前' }] },
        { key: 'relative_between', name: '相对当前时间区间' },
        { key: 'relative_event_time', name: '相对事件发生时间' },

        { key: 'isSet', name: '有值' },
        { key: 'notSet', name: '无值' },
    ],

    /* data_type 为 list 时选 */
    listOpts: [
        { key: 'contain', name: '包含' },
        { key: 'notContain', name: '不包含' },

        { key: 'isEmpty', name: '为空' },
        { key: 'isNotEmpty', name: '不为空' },

        { key: 'isSet', name: '有值' },
        { key: 'notSet', name: '无值' },
    ],

    // 相对事件发生时间 选项
    relativeEventTime: [
        { key: '+', name: '(现在) 之后' },
        { key: '-', name: '(现在) 之前' },
        { key: 'day', name: '今天' },
        { key: 'week', name: '本周' },
        { key: 'month', name: '本月' },
    ],

    // 时间单位
    timeUnit: [
        { key: 'second', name: '秒' },
        { key: 'minute', name: '分种' },
        { key: 'hour', name: '小时' },
        { key: 'day', name: '天' },
    ],


    // 自定义校验条件
    rules: {
        // 可输入多个值
        createCommon: {
            dataTypeArr: ['number', 'string'],      //第一个下拉框
            newDataTypeArr: ['equal', 'notEqual'],  // equal 等于 | notEqual 不等于      第二个下拉框

            key: 'customArr',        //第三个下拉框
        },

        // 可输入单个值
        inputCommon: {
            dataTypeArr: ['number', 'string'],

            // less 小于 | greater 大于 | contain 包含 | notContain 不包含 | rlike 正则匹配 | notrlike 正则不匹配
            newDataTypeArr: ['less', 'greater', 'contain', 'notContain', 'rlike', 'notrlike'],

            key: 'customStr',
        },

        // 数值区间
        numBetween: {
            dataTypeArr: ['number'],
            newDataTypeArr: ['between'],            // between 区间

            key: ['customNumBetween_0', 'customNumBetween_1'],
        },

        // 时间区间 默认
        autoDateBetween: {
            dataTypeArr: ['datetime'],
            newDataTypeArr: ['absolute_between'],   // absolute_between 绝对时间

            key: 'customAutoDateBetween',
        },

        // 相对当前时间点时
        relativeWithin: {
            dataTypeArr: ['datetime'],
            newDataTypeArr: ['relative_within'],   // relative_within 相对当前时间点

            key: ['customNumDate', 'customRelative'],
        },

        // 相对当前时间区间
        dayBetween: {
            dataTypeArr: ['datetime'],
            newDataTypeArr: ['relative_between'],   // relative_within 相对当前时间区间

            key: ['customNumDate_0', 'customNumDate_1'],
        },

        // 相对事件发生时间
        eventTime: {
            dataTypeArr: ['datetime'],
            newDataTypeArr: ['relative_event_time'],   // relative_event_time 相对时间发生时间

            key: ['customEventTime', 'customNumDate_2', 'customTimeUnit']
        },

    },

    initChartViewData:{"by_field":"user.gender","rows":[{"by_value":"女","total_people":6093.0,"cells":[{"people":1157.0,"percent":18.99,"bucket_start":20.0,"bucket_end":30.0},{"people":4070.0,"percent":66.8,"bucket_start":30.0,"bucket_end":50.0},{"people":843.0,"percent":13.84,"bucket_start":50.0,"bucket_end":100.0},{"people":23.0,"percent":0.38,"bucket_start":100.0}]},{"by_value":"男","total_people":6003.0,"cells":[{"people":1154.0,"percent":19.22,"bucket_start":20.0,"bucket_end":30.0},{"people":3965.0,"percent":66.05,"bucket_start":30.0,"bucket_end":50.0},{"people":866.0,"percent":14.43,"bucket_start":50.0,"bucket_end":100.0},{"people":18.0,"percent":0.3,"bucket_start":100.0}]},{"total_people":156.0,"cells":[{"people":0.0,"percent":0.0,"bucket_start":20.0,"bucket_end":30.0},{"people":0.0,"percent":0.0,"bucket_start":30.0,"bucket_end":50.0},{"people":0.0,"percent":0.0,"bucket_start":50.0,"bucket_end":100.0},{"people":156.0,"percent":100.0,"bucket_start":100.0}]}],"report_update_time":"2021-07-18 11:47:56.551","data_update_time":"2021-07-18 11:43:39.000","data_sufficient_update_time":"2021-07-18 11:43:39.000","truncated":false,"sampling_factor":64.0,"is_done":true},

    overviewStep:[
        {label:"LTV 当天", value: 0},
        {label:"LTV 1", value: 1},
        {label:"LTV 2", value: 2},
        {label:"LTV 3", value: 3},
        {label:"LTV 4", value: 4},
        {label:"LTV 5", value: 5},
        {label:"LTV 6", value: 6},
        {label:"LTV 7", value: 7},
        {label:"LTV 15", value: 8},
        {label:"LTV 30", value: 9},
        {label:"LTV 60", value: 10},
        {label:"LTV 90", value: 11}
    ]

};
